<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>下拉菜单</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            list-style: none;
            font-size: 20px;
            color: #f4f1de;
        }
        body {
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            background: linear-gradient(to right,#a18cd1,#fbc2eb);
        }
        .shell {
            display: flex;
            justify-content: center;
        }
        .button,.portrait{
            background-color: #50536e;
            width: 170px;
            height: 65px;
            text-align: center;
            line-height: 65px;
            transition: 0.3s;
            cursor: pointer;
        }
        /* 设置头像框 */
        .portrait::before {
            content: "";
            display: block;
            width: 100px;
            height: 100px;
            border-radius: 50%;
            border: 10px solid #fff;
            transform: translate(25px,-30px);
            background-color: rgb(221, 141, 204);
        }
        /* 头像框下拉菜单封印 */
        .information {
            width: 220px;
            background-color: #e07a5f;
            border-radius: 10px;
            transform: translate(-20px,-95px);
            padding: 20px 0;
            line-height: 0;
            height: 0;
            transition: 0.5s;
            opacity: 0;
        }
        /* 头像框下拉菜单解除封印 */
        .portrait:hover .information {
            opacity: 1;
            line-height: 65px;
            transform: translate(-20px,-10px);
            height: auto;
        }
        .button:hover {
            background-color: #d15a39;
        }
        .button ul li:hover{
            background-color: #ffb29d;
        }
        /* 一级菜单下拉框封印 */
        .button ul li {
            height: 0;
            transition: 0.5s;
            opacity: 0;
            transform: translateY(-65px);
            background-color: #e07a5f;
        }
        /* 一级菜单下拉框解除封印 */
        .button:hover li{
            height: 65px;
            opacity: 1;
            transform: translateY(0);
        }
       

    </style>
</head>
<body>
    <ul class="shell">
        <li class="button">
            <span>消息</span>
            <ul>
                <li>回复我的</li>
                <li>收到的赞</li>
                <li>我的消息</li>
            </ul>
        </li>
        <li class="button">
            <span>动态</span>
        </li>
        <li class="portrait">
            <ul class="information">
                <li>will的前端小窝</li>
                <li>机车发烧友</li>
                <li>htmlcss</li>
                <li>JavaScript</li>
            </ul>
        </li>
        <li class="button">
            <span>收藏</span>
            <ul>
                <li>默认收藏夹</li>
                <li>UI设计</li>
                <li>前端</li>
            </ul>
        </li>
        <li class="button">
            <span>投稿</span>
            <ul>
                <li>专栏投稿</li>
                <li>音频投稿</li>
                <li>视频投稿</li>
                <li>投稿管理</li>
            </ul>
        </li>
    </ul>
</body>
</html>